package com.suixinsanren.design.responsibilitychain.demo01;

public class Chain {

    /**
     * 创建责任链对象，并串联
     * @return 责任链头节点
     */
    public static AbsCheckStudent getStudentCheck() {
        AbsCheckStudent stNameCheck = new StNameCheck();
        AbsCheckStudent stAgeCheck = new StAgeCheck();
        AbsCheckStudent stGenderCheck = new StGenderCheck();
        AbsCheckStudent stNoCheck = new StNoCheck();

        stNameCheck.setAbsCheckStudent(stAgeCheck);
        stAgeCheck.setAbsCheckStudent(stGenderCheck);
        stGenderCheck.setAbsCheckStudent(stNoCheck);

        return stNameCheck;
    }
}
